<template>
    <div>
            <button @click="fun1">管理员登录</button>
            <button @click="fun2">普通用户登录</button>
            <button @click="fun3">清空</button>
    </div>
</template>

<script>
  import  Cookies from 'js-cookie'
    export default {
        name: '',
       methods:{
          fun1( ){
            Cookies.set('user_token', 'admin');
            this.$router.addRoutes([
              { path: '/visitorPage',name: 'visitorPage', component:  () => import('@/views/Visitor/visitorPage') }
            ])
          },
          fun2( ){
            Cookies.set('user_token', 'normal');
          },
         fun3(){
           Cookies.remove('user_token');
         }
      }
    };
</script>

